package com.qiguliuxing.dts.common.type;

import lombok.Getter;

/**
 * 商品佣金设置类型的枚举类
 * 
 * @author qiguliuxing
 * @QQ 623659388
 * @since 1.0.0
 */
@Getter
public enum GoodsBrokerageTypeEnum {

	// 默认情况，无推广佣金
	GOODS_DEFAULT((byte) 0, "无推广佣金"),

	// 自定义佣金模式
	GOODS_SET((byte) 1, "自定义佣金"),

	// 按代理审批比例计算佣金
	APPLY_RATE((byte) 2, "系统审批比例");

	private Byte type;
	private String desc;

	GoodsBrokerageTypeEnum(Byte type, String desc) {
		this.type = type;
		this.desc = desc;
	}

	public static GoodsBrokerageTypeEnum getInstance(Byte type2) {
		if (type2 != null) {
			for (GoodsBrokerageTypeEnum tmp : GoodsBrokerageTypeEnum.values()) {
				if (tmp.type.intValue() == type2.intValue()) {
					return tmp;
				}
			}
		}
		return null;
	}
}
